package com.atguigu.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * 支付模块
 */
@RestController
@Slf4j
public class PaymentController {
    @Value("${server.port}")
    private String serverPort;

    /**
     * 订单微服务调用支付微服务
     * 如果能调通 返回端口号
     *
     * @return
     */
    @RequestMapping(value = "/payment/consul")
    public String getPayment() {
        return "springcloud with consul :" + "\t" + serverPort + UUID.randomUUID().toString();
    }
}
